package com.uzai.console.web.locallive;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.locallive.activity.LocalActivityQuery;
import com.uzai.console.dto.locallive.activity.LocalLiveActivitySetDto;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.locallive.LocalLiveActivityService;
import com.uzai.console.vo.locallive.activity.LocalLiveActivitySetVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 本地生活活动设置
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "本地生活活动设置",tags = "本地生活|活动设置")
@ApiSort(13)
@RestController
public class LocalLiveActivityController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(LocalLiveActivityController.class);

    @Autowired
    private LocalLiveActivityService meituanActivityService;

    @ApiOperation(value = "查询本地生活活动列表设置", notes = "查询本地生活活动列表设置", response = LocalLiveActivitySetVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/localLiveActivity/findLocalLiveActivityList")
    public Object findLocalLiveActivityList(@RequestBody LocalActivityQuery meituanActivityQuery){
        return meituanActivityService.findLocalLiveActivityList(meituanActivityQuery);
    }

    @SystemLogType(model = SystemModelEnum.LocalliveMeituanActivity, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "修改本地生活活动设置", notes = "修改本地生活活动设置", response = Boolean.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/localLiveActivity/updateLocalLiveActivitySet")
    public Object updateLocalLiveActivitySet(@RequestBody LocalLiveActivitySetDto meituanActivitySetDto){
        meituanActivityService.updateLocalLiveActivitySet(meituanActivitySetDto);
        return true;
    }

}
